package com.ruoyi.tjfx.service;


import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.BigDecimalUtil;
import com.ruoyi.report_chl.domain.vo.ChlFmhbgBsInfoVo;
import com.ruoyi.report_chl.mapper.ChlFmhbgBsInfoMapper;
import com.ruoyi.report_chl.service.IChlFmhbgBsInfoService;
import com.ruoyi.report_gc.mapper.GcjxljjtbgBsInfoMapper;
import com.ruoyi.report_gc.mapper.GcsyjcbgBsInfoMapper;
import com.ruoyi.report_gc.mapper.GjhjjtbgBsInfoMapper;
import com.ruoyi.report_gc.service.IGcjxljjtbgBsInfoService;
import com.ruoyi.report_gc.service.IGcsyjcbgBsInfoService;
import com.ruoyi.report_gc.service.IGjhjjtbgBsInfoService;
import com.ruoyi.report_jkdj.mapper.DjczlbgBsInfoMapper;
import com.ruoyi.report_jkdj.service.IDjczlbgBsInfoService;
import com.ruoyi.report_jl.domain.vo.ReportJlCjllmysybgBsInfoVo;
import com.ruoyi.report_jl.domain.vo.ReportJlCjlsnhntysybgBsInfoVo;
import com.ruoyi.report_jl.domain.vo.ReportJlCjlwjjhlysybgBsInfoVo;
import com.ruoyi.report_jl.mapper.ReportJlCjllmysybgBsInfoMapper;
import com.ruoyi.report_jl.service.IReportJlCjllmysybgBsInfoService;
import com.ruoyi.report_jl.service.IReportJlCjlsnhntysybgBsInfoService;
import com.ruoyi.report_jl.service.IReportJlCjlwjjhlysybgBsInfoService;
import com.ruoyi.report_ljlm.mapper.WcbgBsInfoMapper;
import com.ruoyi.report_ljlm.service.IWcbgBsInfoService;
import com.ruoyi.report_sj.mapper.ReportSjPhbsjsyjcbgBsInfoMapper;
import com.ruoyi.report_sj.service.IReportSjPhbsjsyjcbgBsInfoService;
import com.ruoyi.report_sn.domain.vo.SnsybgBsInfoVo;
import com.ruoyi.report_sn.mapper.SnsybgBsInfoMapper;
import com.ruoyi.report_sn.service.ISnsybgBsInfoService;
import com.ruoyi.report_tg.domain.vo.TgsybgBaDetailVo;
import com.ruoyi.report_tg.domain.vo.TgsybgBsInfoVo;
import com.ruoyi.report_tg.mapper.TgsybgBsInfoMapper;
import com.ruoyi.report_tg.service.ITgsybgBsInfoService;
import com.ruoyi.reportsnhnt.mapper.ReportSnhntPhbbgBsInfoMapper;
import com.ruoyi.reportsnhnt.service.IReportSnhntPhbbgBsInfoService;
import com.ruoyi.report_yj.mapper.SnjjqdsybgBsInfoMapper;
import com.ruoyi.report_yj.service.ISnjjqdsybgBsInfoService;
import com.ruoyi.syrw.domain.bo.BsDataReportBo;
import com.ruoyi.syrw.domain.bo.TaiZhangQueryBo;
import com.ruoyi.syrw.domain.vo.TaiZhangVo;
import com.ruoyi.syrw.service.IBsDataReportService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Map;

@RequiredArgsConstructor
@Service
public class ReportTJFXService {

    private final IBsDataReportService iBsDataReportService;
    private final TgsybgBsInfoMapper tgsybgBsInfoMapper; // 土工
    private final ITgsybgBsInfoService tgsybgBsInfoService;
    private final ReportJlCjllmysybgBsInfoMapper cjllmysybgBsInfoMapper; // 粗集料
    private final IReportJlCjllmysybgBsInfoService cjllmysybgBsInfoService;
    private final IReportJlCjlwjjhlysybgBsInfoService cjlwjjhlysybgBsInfoService;
    private final IReportJlCjlsnhntysybgBsInfoService cjlsnhntysybgBsInfoService;

    private final ChlFmhbgBsInfoMapper chlFmhbgBsInfoMapper; // 掺合料
    private final IChlFmhbgBsInfoService chlFmhbgBsInfoService;

    private final DjczlbgBsInfoMapper djczlbgBsInfoMapper; // 地基承载力
    private final IDjczlbgBsInfoService djczlbgBsInfoService;

    private final GcjxljjtbgBsInfoMapper gcjxljjtbgBsInfoMapper; // 钢筋机械连接试验
    private final IGcjxljjtbgBsInfoService gcjxljjtbgBsInfoService;

    private final GcsyjcbgBsInfoMapper gcsyjcbgBsInfoMapper; // 钢材试验
    private final IGcsyjcbgBsInfoService gcsyjcbgBsInfoService;

    private final GjhjjtbgBsInfoMapper gjhjjtbgBsInfoMapper; // 钢筋焊接试验
    private final IGjhjjtbgBsInfoService gjhjjtbgBsInfoService;

    private final SnsybgBsInfoMapper snsybgBsInfoMapper; // 水泥试验
    private final ISnsybgBsInfoService snsybgBsInfoService;

    private final SnjjqdsybgBsInfoMapper snjjqdsybgBsInfoMapper; // 压浆试验
    private final ISnjjqdsybgBsInfoService snjjqdsybgBsInfoService;
    // xs begin
    private final ReportSnhntPhbbgBsInfoMapper snhntPhbbgBsInfoMapper; // 普通混凝土配合比
    private final IReportSnhntPhbbgBsInfoService snhntPhbbgBsInfoService;
    private final ReportSjPhbsjsyjcbgBsInfoMapper sjPhbsjsyjcbgBsInfoMapper; //  砂浆配合比
    private final IReportSjPhbsjsyjcbgBsInfoService sjPhbsjsyjcbgBsInfoService;
    // xs end

    private final WcbgBsInfoMapper wcbgBsInfoMapper; // 路基路面回弹弯沉试验
    private final IWcbgBsInfoService wcbgBsInfoService;

    /**
     * tai zhang
     */
    public TableDataInfo taiZhang(TaiZhangQueryBo bo, PageQuery pageQuery) {
        // 土工
        if (2L == bo.getSyType()) {
            // 1. 先分页查到excelId
            Page<TgsybgBsInfoVo> tgsybgBsInfoVoPage = tgsybgBsInfoMapper.taiZhangPage(pageQuery.build(), bo);
            // 2. 再 填充必要字段
            if (CollUtil.isNotEmpty(tgsybgBsInfoVoPage.getRecords())) {
                Long excelId;
                for (int i = 0; i < tgsybgBsInfoVoPage.getRecords().size(); i++) {
                    excelId = tgsybgBsInfoVoPage.getRecords().get(i).getExcelId();
                    TgsybgBsInfoVo tgsybgBsInfoVo = tgsybgBsInfoService.queryByIdForTaizhang(excelId);
                    // 详细表提到外层
                    Map<Long, TgsybgBaDetailVo> baDetailVos = tgsybgBsInfoVo.getBaDetailVos();
                    if (CollUtil.isNotEmpty(baDetailVos)) {
                        tgsybgBsInfoVo.setHsl(baDetailVos.get(1L) != null ? BigDecimalUtil.toString(baDetailVos.get(1L).getJiancjg()) : null);
                        tgsybgBsInfoVo.setMd(baDetailVos.get(2L) != null ? BigDecimalUtil.toString(baDetailVos.get(2L).getJiancjg()) : null);
                        tgsybgBsInfoVo.setYx(baDetailVos.get(3L) != null ? BigDecimalUtil.toString(baDetailVos.get(3L).getJiancjg()) : null);
                        tgsybgBsInfoVo.setSx(baDetailVos.get(4L) != null ? BigDecimalUtil.toString(baDetailVos.get(4L).getJiancjg()) : null);
                        tgsybgBsInfoVo.setSxzs(baDetailVos.get(5L) != null ? BigDecimalUtil.toString(baDetailVos.get(5L).getJiancjg()) : null);
                        tgsybgBsInfoVo.setTrcd(baDetailVos.get(6L) != null ? BigDecimalUtil.toString(baDetailVos.get(6L).getJiancjg()) : null);
                        tgsybgBsInfoVo.setZdgmd(baDetailVos.get(8L) != null ? BigDecimalUtil.toString(baDetailVos.get(8L).getJiancjg()) : null);
                        tgsybgBsInfoVo.setZjhsl(baDetailVos.get(9L) != null ? BigDecimalUtil.toString(baDetailVos.get(9L).getJiancjg()) : null);
                        tgsybgBsInfoVo.setCbr93(baDetailVos.get(14L) != null ? BigDecimalUtil.toString(baDetailVos.get(14L).getJiancjg()) : null);
                        tgsybgBsInfoVo.setCbr94(baDetailVos.get(15L) != null ? BigDecimalUtil.toString(baDetailVos.get(15L).getJiancjg()) : null);
                        tgsybgBsInfoVo.setCbr96(baDetailVos.get(16L) != null ? BigDecimalUtil.toString(baDetailVos.get(16L).getJiancjg()) : null);
                        tgsybgBsInfoVo.setYjzhl(baDetailVos.get(17L) != null ? BigDecimalUtil.toString(baDetailVos.get(17L).getJiancjg()) : null);
                        tgsybgBsInfoVo.setSsl(baDetailVos.get(18L) != null ? BigDecimalUtil.toString(baDetailVos.get(18L).getJiancjg()) : null);

                    }
                    tgsybgBsInfoVo.setXuhao(i + 1);
                    tgsybgBsInfoVoPage.getRecords().set(i, tgsybgBsInfoVo);
                }
            }
            return TableDataInfo.build(tgsybgBsInfoVoPage);
        }
        // 粗集料
        else if (4L == bo.getSyType()) {
            // 1. 先分页查到excelId
            Page voPages = cjllmysybgBsInfoMapper.taiZhangPage(pageQuery.build(), bo);
            // 2. 再 填充必要字段
            if (CollUtil.isNotEmpty(voPages.getRecords())) {
                for (int i = 0; i < voPages.getRecords().size(); i++) {
                    TaiZhangVo vo = (TaiZhangVo) voPages.getRecords().get(i);
                    if (StrUtil.equals(vo.getType(), "路面用")) {
                        ReportJlCjllmysybgBsInfoVo vo1 = cjllmysybgBsInfoService.queryByIdForTaizhang(vo.getExcelId());
                        // 详细表提到外层
                        Map<Long, TgsybgBaDetailVo> baDetailVos = vo1.getBaDetailVos();
                        if (CollUtil.isNotEmpty(baDetailVos)) {
                            vo1.setKey12(baDetailVos.get(12L) != null ? BigDecimalUtil.toString(baDetailVos.get(12L).getJiancjg()) : null);
                            vo1.setKey19(baDetailVos.get(19L) != null ? BigDecimalUtil.toString(baDetailVos.get(19L).getJiancjg()) : null);
                            vo1.setKey20(baDetailVos.get(20L) != null ? BigDecimalUtil.toString(baDetailVos.get(20L).getJiancjg()) : null);
                            vo1.setKey21(baDetailVos.get(21L) != null ? BigDecimalUtil.toString(baDetailVos.get(21L).getJiancjg()) : null);
                            vo1.setKey22(baDetailVos.get(22L) != null ? BigDecimalUtil.toString(baDetailVos.get(22L).getJiancjg()) : null);
                            vo1.setKey23(baDetailVos.get(23L) != null ? BigDecimalUtil.toString(baDetailVos.get(23L).getJiancjg()) : null);
                            vo1.setKey24(baDetailVos.get(24L) != null ? BigDecimalUtil.toString(baDetailVos.get(24L).getJiancjg()) : null);
                            vo1.setKey25(baDetailVos.get(25L) != null ? BigDecimalUtil.toString(baDetailVos.get(25L).getJiancjg()) : null);
                            vo1.setKey26(baDetailVos.get(26L) != null ? BigDecimalUtil.toString(baDetailVos.get(26L).getJiancjg()) : null);
                            vo1.setKey27(baDetailVos.get(27L) != null ? BigDecimalUtil.toString(baDetailVos.get(27L).getJiancjg()) : null);
                            vo1.setKey28(baDetailVos.get(28L) != null ? BigDecimalUtil.toString(baDetailVos.get(28L).getJiancjg()) : null);
                            vo1.setKey29(baDetailVos.get(29L) != null ? BigDecimalUtil.toString(baDetailVos.get(29L).getJiancjg()) : null);
                            vo1.setKey30(baDetailVos.get(30L) != null ? BigDecimalUtil.toString(baDetailVos.get(30L).getJiancjg()) : null);
                            vo1.setKey31(baDetailVos.get(31L) != null ? BigDecimalUtil.toString(baDetailVos.get(31L).getJiancjg()) : null);
                            vo1.setKey32(baDetailVos.get(32L) != null ? BigDecimalUtil.toString(baDetailVos.get(32L).getJiancjg()) : null);
                            vo1.setKey33(baDetailVos.get(33L) != null ? BigDecimalUtil.toString(baDetailVos.get(33L).getJiancjg()) : null);
                            vo1.setKey34(baDetailVos.get(34L) != null ? BigDecimalUtil.toString(baDetailVos.get(34L).getJiancjg()) : null);
                            vo1.setKey35(baDetailVos.get(36L) != null ? BigDecimalUtil.toString(baDetailVos.get(36L).getJiancjg()) : null);
                            vo1.setKey37(baDetailVos.get(37L) != null ? BigDecimalUtil.toString(baDetailVos.get(37L).getJiancjg()) : null);
                            vo1.setKey38(baDetailVos.get(38L) != null ? BigDecimalUtil.toString(baDetailVos.get(38L).getJiancjg()) : null);
                            vo1.setKey159(baDetailVos.get(159L) != null ? BigDecimalUtil.toString(baDetailVos.get(159L).getJiancjg()) : null);
                            vo1.setKey160(baDetailVos.get(160L) != null ? BigDecimalUtil.toString(baDetailVos.get(160L).getJiancjg()) : null);
                            vo1.setKey161(baDetailVos.get(161L) != null ? BigDecimalUtil.toString(baDetailVos.get(161L).getJiancjg()) : null);
                            vo1.setKey162(baDetailVos.get(162L) != null ? BigDecimalUtil.toString(baDetailVos.get(162L).getJiancjg()) : null);

                        }
                        vo1.setXuhao(i + 1);
                        voPages.getRecords().set(i, vo1);
                    } else if (StrUtil.equals(vo.getType(), "无机结合料用")) {
                        ReportJlCjlwjjhlysybgBsInfoVo vo1 = cjlwjjhlysybgBsInfoService.queryByIdForTaizhang(vo.getExcelId());
                        // 详细表提到外层
                        Map<Long, TgsybgBaDetailVo> baDetailVos = vo1.getBaDetailVos();
                        if (CollUtil.isNotEmpty(baDetailVos)) {
                            vo1.setKey12(baDetailVos.get(12L) != null ? BigDecimalUtil.toString(baDetailVos.get(12L).getJiancjg()) : null);
                            vo1.setKey19(baDetailVos.get(19L) != null ? BigDecimalUtil.toString(baDetailVos.get(19L).getJiancjg()) : null);
                            vo1.setKey20(baDetailVos.get(20L) != null ? BigDecimalUtil.toString(baDetailVos.get(20L).getJiancjg()) : null);
                            vo1.setKey21(baDetailVos.get(21L) != null ? BigDecimalUtil.toString(baDetailVos.get(21L).getJiancjg()) : null);
                            vo1.setKey22(baDetailVos.get(22L) != null ? BigDecimalUtil.toString(baDetailVos.get(22L).getJiancjg()) : null);
                            vo1.setKey23(baDetailVos.get(23L) != null ? BigDecimalUtil.toString(baDetailVos.get(23L).getJiancjg()) : null);
                            vo1.setKey24(baDetailVos.get(24L) != null ? BigDecimalUtil.toString(baDetailVos.get(24L).getJiancjg()) : null);
                            vo1.setKey25(baDetailVos.get(25L) != null ? BigDecimalUtil.toString(baDetailVos.get(25L).getJiancjg()) : null);
                            vo1.setKey26(baDetailVos.get(26L) != null ? BigDecimalUtil.toString(baDetailVos.get(26L).getJiancjg()) : null);
                            vo1.setKey27(baDetailVos.get(27L) != null ? BigDecimalUtil.toString(baDetailVos.get(27L).getJiancjg()) : null);
                            vo1.setKey28(baDetailVos.get(28L) != null ? BigDecimalUtil.toString(baDetailVos.get(28L).getJiancjg()) : null);
                            vo1.setKey29(baDetailVos.get(29L) != null ? BigDecimalUtil.toString(baDetailVos.get(29L).getJiancjg()) : null);
                            vo1.setKey30(baDetailVos.get(30L) != null ? BigDecimalUtil.toString(baDetailVos.get(30L).getJiancjg()) : null);
                            vo1.setKey31(baDetailVos.get(31L) != null ? BigDecimalUtil.toString(baDetailVos.get(31L).getJiancjg()) : null);
                            vo1.setKey32(baDetailVos.get(32L) != null ? BigDecimalUtil.toString(baDetailVos.get(32L).getJiancjg()) : null);
                            vo1.setKey33(baDetailVos.get(33L) != null ? BigDecimalUtil.toString(baDetailVos.get(33L).getJiancjg()) : null);
                            vo1.setKey34(baDetailVos.get(34L) != null ? BigDecimalUtil.toString(baDetailVos.get(34L).getJiancjg()) : null);
                            vo1.setKey35(baDetailVos.get(36L) != null ? BigDecimalUtil.toString(baDetailVos.get(36L).getJiancjg()) : null);
                            vo1.setKey37(baDetailVos.get(37L) != null ? BigDecimalUtil.toString(baDetailVos.get(37L).getJiancjg()) : null);
                            vo1.setKey38(baDetailVos.get(38L) != null ? BigDecimalUtil.toString(baDetailVos.get(38L).getJiancjg()) : null);
                            vo1.setKey159(baDetailVos.get(159L) != null ? BigDecimalUtil.toString(baDetailVos.get(159L).getJiancjg()) : null);
                            vo1.setKey160(baDetailVos.get(160L) != null ? BigDecimalUtil.toString(baDetailVos.get(160L).getJiancjg()) : null);
                            vo1.setKey161(baDetailVos.get(161L) != null ? BigDecimalUtil.toString(baDetailVos.get(161L).getJiancjg()) : null);
                            vo1.setKey162(baDetailVos.get(162L) != null ? BigDecimalUtil.toString(baDetailVos.get(162L).getJiancjg()) : null);

                        }
                        vo1.setXuhao(i + 1);
                        voPages.getRecords().set(i, vo1);
                    } else if (StrUtil.equals(vo.getType(), "混凝土用")) {
                        ReportJlCjlsnhntysybgBsInfoVo vo1 = cjlsnhntysybgBsInfoService.queryByIdForTaizhang(vo.getExcelId());
                        // 详细表提到外层
                        Map<Long, TgsybgBaDetailVo> baDetailVos = vo1.getBaDetailVos();
                        if (CollUtil.isNotEmpty(baDetailVos)) {
                            vo1.setKey12(baDetailVos.get(12L) != null ? BigDecimalUtil.toString(baDetailVos.get(12L).getJiancjg()) : null);
                            vo1.setKey19(baDetailVos.get(19L) != null ? BigDecimalUtil.toString(baDetailVos.get(19L).getJiancjg()) : null);
                            vo1.setKey20(baDetailVos.get(20L) != null ? BigDecimalUtil.toString(baDetailVos.get(20L).getJiancjg()) : null);
                            vo1.setKey21(baDetailVos.get(21L) != null ? BigDecimalUtil.toString(baDetailVos.get(21L).getJiancjg()) : null);
                            vo1.setKey22(baDetailVos.get(22L) != null ? BigDecimalUtil.toString(baDetailVos.get(22L).getJiancjg()) : null);
                            vo1.setKey23(baDetailVos.get(23L) != null ? BigDecimalUtil.toString(baDetailVos.get(23L).getJiancjg()) : null);
                            vo1.setKey24(baDetailVos.get(24L) != null ? BigDecimalUtil.toString(baDetailVos.get(24L).getJiancjg()) : null);
                            vo1.setKey25(baDetailVos.get(25L) != null ? BigDecimalUtil.toString(baDetailVos.get(25L).getJiancjg()) : null);
                            vo1.setKey26(baDetailVos.get(26L) != null ? BigDecimalUtil.toString(baDetailVos.get(26L).getJiancjg()) : null);
                            vo1.setKey27(baDetailVos.get(27L) != null ? BigDecimalUtil.toString(baDetailVos.get(27L).getJiancjg()) : null);
                            vo1.setKey28(baDetailVos.get(28L) != null ? BigDecimalUtil.toString(baDetailVos.get(28L).getJiancjg()) : null);
                            vo1.setKey29(baDetailVos.get(29L) != null ? BigDecimalUtil.toString(baDetailVos.get(29L).getJiancjg()) : null);
                            vo1.setKey30(baDetailVos.get(30L) != null ? BigDecimalUtil.toString(baDetailVos.get(30L).getJiancjg()) : null);
                            vo1.setKey31(baDetailVos.get(31L) != null ? BigDecimalUtil.toString(baDetailVos.get(31L).getJiancjg()) : null);
                            vo1.setKey32(baDetailVos.get(32L) != null ? BigDecimalUtil.toString(baDetailVos.get(32L).getJiancjg()) : null);
                            vo1.setKey33(baDetailVos.get(33L) != null ? BigDecimalUtil.toString(baDetailVos.get(33L).getJiancjg()) : null);
                            vo1.setKey34(baDetailVos.get(34L) != null ? BigDecimalUtil.toString(baDetailVos.get(34L).getJiancjg()) : null);
                            vo1.setKey35(baDetailVos.get(36L) != null ? BigDecimalUtil.toString(baDetailVos.get(36L).getJiancjg()) : null);
                            vo1.setKey37(baDetailVos.get(37L) != null ? BigDecimalUtil.toString(baDetailVos.get(37L).getJiancjg()) : null);
                            vo1.setKey38(baDetailVos.get(38L) != null ? BigDecimalUtil.toString(baDetailVos.get(38L).getJiancjg()) : null);
                            vo1.setKey159(baDetailVos.get(159L) != null ? BigDecimalUtil.toString(baDetailVos.get(159L).getJiancjg()) : null);
                            vo1.setKey160(baDetailVos.get(160L) != null ? BigDecimalUtil.toString(baDetailVos.get(160L).getJiancjg()) : null);
                            vo1.setKey161(baDetailVos.get(161L) != null ? BigDecimalUtil.toString(baDetailVos.get(161L).getJiancjg()) : null);
                            vo1.setKey162(baDetailVos.get(162L) != null ? BigDecimalUtil.toString(baDetailVos.get(162L).getJiancjg()) : null);

                        }
                        vo1.setXuhao(i + 1);
                        voPages.getRecords().set(i, vo1);

                    }

                }
            }
            return TableDataInfo.build(voPages);
        }
        // todo 细集料 复制粗集料修改 tll
        else if (5L == bo.getSyType()) {

        }
        //  钢筋原材试验  lb
        else if (25L == bo.getSyType()) {
            // 1. 先分页查到excelId
            Page voPages = gcsyjcbgBsInfoMapper.taiZhangPage(pageQuery.build(), bo);
            // 2. 再 填充必要字段
            if (CollUtil.isNotEmpty(voPages.getRecords())) {
                for (int i = 0; i < voPages.getRecords().size(); i++) {
                    TaiZhangVo vo = (TaiZhangVo) voPages.getRecords().get(i);
                    voPages.getRecords().set(i, gcsyjcbgBsInfoService.queryByIdForTaizhang(vo.getExcelId()));
                }
            }
            return TableDataInfo.build(voPages);
        }
        //  钢筋焊接试验  lb
        else if (136L == bo.getSyType()) {
            // 1. 先分页查到excelId
            Page voPages = gjhjjtbgBsInfoMapper.taiZhangPage(pageQuery.build(), bo);
            // 2. 再 填充必要字段
            if (CollUtil.isNotEmpty(voPages.getRecords())) {
                for (int i = 0; i < voPages.getRecords().size(); i++) {
                    TaiZhangVo vo = (TaiZhangVo) voPages.getRecords().get(i);
                    voPages.getRecords().set(i, gjhjjtbgBsInfoService.queryByIdForTaizhang(vo.getExcelId()));
                }
            }
            return TableDataInfo.build(voPages);
        }
        // 钢筋机械连接试验 lb
        else if (137L == bo.getSyType()) {
            // 1. 先分页查到excelId
            Page voPages = gcjxljjtbgBsInfoMapper.taiZhangPage(pageQuery.build(), bo);
            // 2. 再 填充必要字段
            if (CollUtil.isNotEmpty(voPages.getRecords())) {
                for (int i = 0; i < voPages.getRecords().size(); i++) {
                    TaiZhangVo vo = (TaiZhangVo) voPages.getRecords().get(i);
                    voPages.getRecords().set(i, gcjxljjtbgBsInfoService.queryByIdForTaizhang(vo.getExcelId()));
                }
            }
            return TableDataInfo.build(voPages);
        }
        // 粉煤灰试验（掺合料） zyb
        else if (22L == bo.getSyType()) {
            // 1. 先分页查到excelId
            Page voPages = chlFmhbgBsInfoMapper.taiZhangPage(pageQuery.build(), bo);
            // 2. 再 填充必要字段
            if (CollUtil.isNotEmpty(voPages.getRecords())) {
                for (int i = 0; i < voPages.getRecords().size(); i++) {
                    TaiZhangVo vo = (TaiZhangVo) voPages.getRecords().get(i);
                    ChlFmhbgBsInfoVo chlFmhbgBsInfoVo = chlFmhbgBsInfoService.queryByIdForTaizhang(vo.getExcelId());
                    chlFmhbgBsInfoVo.setXuhao(i + 1);
                    voPages.getRecords().set(i, chlFmhbgBsInfoVo);
                }
            }
            return TableDataInfo.build(voPages);
        }
        //  水泥 复制粗集料修改 lb
        else if (10L == bo.getSyType()) {
            // 1. 先分页查到excelId
            Page voPages = snsybgBsInfoMapper.taiZhangPage(pageQuery.build(), bo);
            // 2. 再 填充必要字段
            if (CollUtil.isNotEmpty(voPages.getRecords())) {
                for (int i = 0; i < voPages.getRecords().size(); i++) {
                    TaiZhangVo vo = (TaiZhangVo) voPages.getRecords().get(i);
                    SnsybgBsInfoVo snsybgBsInfoVo = snsybgBsInfoService.queryByIdForTaizhang(vo.getExcelId());
                    snsybgBsInfoVo.setXuhao(i + 1);
                    voPages.getRecords().set(i, snsybgBsInfoVo);
                }
            }
            return TableDataInfo.build(voPages);
        }
        // 水泥混凝土配合比 复制粗集料修改 xs
        else if (14L == bo.getSyType()) {
            // 1. 先分页查到excelId
            Page voPages = snhntPhbbgBsInfoMapper.taiZhangPage(pageQuery.build(), bo);
            // 2. 再 填充必要字段
            if (CollUtil.isNotEmpty(voPages.getRecords())) {
                for (int i = 0; i < voPages.getRecords().size(); i++) {
                    TaiZhangVo vo = (TaiZhangVo) voPages.getRecords().get(i);
                    voPages.getRecords().set(i, snhntPhbbgBsInfoService.queryByIdForTaizhang(vo.getExcelId()));
                }
            }
            return TableDataInfo.build(voPages);
        }
        //  水泥砂浆配合比试验 复制粗集料修改 xs
        else if (17L == bo.getSyType()) {
            // 1. 先分页查到excelId
            Page voPages = sjPhbsjsyjcbgBsInfoMapper.taiZhangPage(pageQuery.build(), bo);
            // 2. 再 填充必要字段
            if (CollUtil.isNotEmpty(voPages.getRecords())) {
                for (int i = 0; i < voPages.getRecords().size(); i++) {
                    TaiZhangVo vo = (TaiZhangVo) voPages.getRecords().get(i);
                    voPages.getRecords().set(i, sjPhbsjsyjcbgBsInfoService.queryByIdForTaizhang(vo.getExcelId()));
                }
            }
            return TableDataInfo.build(voPages);

        }
        // todo 沥青混合料配合比 复制粗集料修改 lb
        else if (139L == bo.getSyType()) {

        }
        // 基坑、地基与桩基试验 复制粗集料修改 zyb
        else if (31L == bo.getSyType()) {
            // 1. 先分页查到excelId
            Page voPages = djczlbgBsInfoMapper.taiZhangPage(pageQuery.build(), bo);
            // 2. 再 填充必要字段
            if (CollUtil.isNotEmpty(voPages.getRecords())) {
                for (int i = 0; i < voPages.getRecords().size(); i++) {
                    TaiZhangVo vo = (TaiZhangVo) voPages.getRecords().get(i);
                    voPages.getRecords().set(i, djczlbgBsInfoService.queryByIdForTaizhang(vo.getExcelId()));
                }
            }
            return TableDataInfo.build(voPages);
        }
        // 压浆材料 lb
        else if (69L == bo.getSyType()) {
            // 1. 先分页查到excelId
            Page voPages = snjjqdsybgBsInfoMapper.taiZhangPage(pageQuery.build(), bo);
            // 2. 再 填充必要字段
            if (CollUtil.isNotEmpty(voPages.getRecords())) {
                for (int i = 0; i < voPages.getRecords().size(); i++) {
                    TaiZhangVo vo = (TaiZhangVo) voPages.getRecords().get(i);
                    voPages.getRecords().set(i, snjjqdsybgBsInfoService.queryByIdForTaizhang(vo.getExcelId()));
                }
            }
            return TableDataInfo.build(voPages);
        }
        // 路基路面回弹弯沉试验 lb
        else if (135L == bo.getSyType()) {
            // 1. 先分页查到excelId
            Page voPages = wcbgBsInfoMapper.taiZhangPage(pageQuery.build(), bo);
            // 2. 再 填充必要字段
            if (CollUtil.isNotEmpty(voPages.getRecords())) {
                for (int i = 0; i < voPages.getRecords().size(); i++) {
                    TaiZhangVo vo = (TaiZhangVo) voPages.getRecords().get(i);
                    voPages.getRecords().set(i, wcbgBsInfoService.queryByIdForTaizhang(vo.getExcelId()));
                }
            }
            return TableDataInfo.build(voPages);
        }


        return TableDataInfo.build();
    }

    /**
     * 不合格台账查询方法
     * 本方法用于查询不合格的台账信息，通过设置报告结果状态为2来过滤查询结果
     *
     * @param bo        BsDataReportBo对象，包含查询条件和报告相关信息
     * @param pageQuery PageQuery对象，包含分页查询参数
     * @return 返回TableDataInfo对象，包含分页查询结果
     */
    public TableDataInfo bhgtz(BsDataReportBo bo, PageQuery pageQuery) {
        // 设置报告结果状态为2，表示不合格
        bo.setReportResult(2);
        // 调用服务层方法查询不合格台账的分页列表
        return iBsDataReportService.queryPageList(bo, pageQuery);
    }
}
